package com.bluemoon.model.test.dbImort.visitor;

import cn.afterturn.easypoi.handler.inter.IExcelDataHandler;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import com.bluemoon.model.test.dbImort.visitor.file.ExcelFile;
import com.bluemoon.model.test.dbImort.visitor.po.ExtractResultSet;

/**
 * 提取文件内容到结果集
 *
 * @author Jarod.Kong
 * @date 2021/2/4 13:36
 */
public class ExtractFile2ResultSetVisitor<T> implements ExtractVisitor<T> {
    private IExcelVerifyHandler<T> excelVerifyHandler;
    private IExcelDataHandler<T> excelDataHandler;

    public ExtractFile2ResultSetVisitor(IExcelVerifyHandler<T> excelVerifyHandler,
                                        IExcelDataHandler<T> excelDataHandler) {
        this.excelVerifyHandler = excelVerifyHandler;
        this.excelDataHandler = excelDataHandler;
    }

    public ExtractFile2ResultSetVisitor() {
    }

    @Override
    public <T> ExtractResultSet<T> visitor(ExcelFile excelFile) {
        String filePath = excelFile.getFilePath();
        return ExtractResultSet.empty();
    }

    public ExtractFile2ResultSetVisitor<T> setExcelDataHandler(IExcelDataHandler<T> excelDataHandler) {
        this.excelDataHandler = excelDataHandler;
        return this;
    }

    public ExtractFile2ResultSetVisitor<T> setExcelVerifyHandler(IExcelVerifyHandler<T> excelVerifyHandler) {
        this.excelVerifyHandler = excelVerifyHandler;
        return this;
    }
}
